class Solution
{
public:
    vector<int> FindNumbersWithSum(vector<int> array, int sum)
    {
        int left = 0;
        int right = array.size() - 1;
        while (left < right)
        {
            if (array[left] + array[right] > sum)
            {
                right--;
            }
            else if (array[left] + array[right] < sum)
            {
                left++;
            }
            else return { array[left],array[right] };
        }
        return { };
    }
};